ag-cortex 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/commands/test-browser.md +339 -0
- package/.agent/rules/00-constitution.md +46 -0
- package/.agent/rules/project-rules.md +49 -0
- package/.agent/skills/agent-browser/SKILL.md +223 -0
- package/.agent/skills/agent-native-architecture/SKILL.md +435 -0
- package/.agent/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
- package/.agent/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
- package/.agent/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
- package/.agent/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
- package/.agent/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
- package/.agent/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
- package/.agent/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
- package/.agent/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
- package/.agent/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
- package/.agent/skills/agent-native-architecture/references/product-implications.md +443 -0
- package/.agent/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
- package/.agent/skills/agent-native-architecture/references/self-modification.md +269 -0
- package/.agent/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
- package/.agent/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
- package/.agent/skills/agent-native-reviewer/SKILL.md +246 -0
- package/.agent/skills/andrew-kane-gem-writer/SKILL.md +184 -0
- package/.agent/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
- package/.agent/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
- package/.agent/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
- package/.agent/skills/andrew-kane-gem-writer/references/resources.md +119 -0
- package/.agent/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
- package/.agent/skills/ankane-readme-writer/SKILL.md +50 -0
- package/.agent/skills/architecture-strategist/SKILL.md +52 -0
- package/.agent/skills/best-practices-researcher/SKILL.md +100 -0
- package/.agent/skills/bug-reproduction-validator/SKILL.md +67 -0
- package/.agent/skills/code-simplicity-reviewer/SKILL.md +85 -0
- package/.agent/skills/coding-tutor/.claude-plugin/plugin.json +9 -0
- package/.agent/skills/coding-tutor/README.md +37 -0
- package/.agent/skills/coding-tutor/commands/quiz-me.md +1 -0
- package/.agent/skills/coding-tutor/commands/sync-tutorials.md +25 -0
- package/.agent/skills/coding-tutor/commands/teach-me.md +1 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +202 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +203 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +132 -0
- package/.agent/skills/compound-docs/SKILL.md +510 -0
- package/.agent/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/.agent/skills/compound-docs/assets/resolution-template.md +93 -0
- package/.agent/skills/compound-docs/references/yaml-schema.md +65 -0
- package/.agent/skills/compound-docs/schema.yaml +176 -0
- package/.agent/skills/create-agent-skills/SKILL.md +299 -0
- package/.agent/skills/create-agent-skills/references/api-security.md +226 -0
- package/.agent/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
- package/.agent/skills/create-agent-skills/references/best-practices.md +404 -0
- package/.agent/skills/create-agent-skills/references/common-patterns.md +595 -0
- package/.agent/skills/create-agent-skills/references/core-principles.md +437 -0
- package/.agent/skills/create-agent-skills/references/executable-code.md +175 -0
- package/.agent/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
- package/.agent/skills/create-agent-skills/references/official-spec.md +185 -0
- package/.agent/skills/create-agent-skills/references/recommended-structure.md +168 -0
- package/.agent/skills/create-agent-skills/references/skill-structure.md +372 -0
- package/.agent/skills/create-agent-skills/references/using-scripts.md +113 -0
- package/.agent/skills/create-agent-skills/references/using-templates.md +112 -0
- package/.agent/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
- package/.agent/skills/create-agent-skills/templates/router-skill.md +73 -0
- package/.agent/skills/create-agent-skills/templates/simple-skill.md +33 -0
- package/.agent/skills/create-agent-skills/workflows/add-reference.md +96 -0
- package/.agent/skills/create-agent-skills/workflows/add-script.md +93 -0
- package/.agent/skills/create-agent-skills/workflows/add-template.md +74 -0
- package/.agent/skills/create-agent-skills/workflows/add-workflow.md +120 -0
- package/.agent/skills/create-agent-skills/workflows/audit-skill.md +138 -0
- package/.agent/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
- package/.agent/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
- package/.agent/skills/create-agent-skills/workflows/get-guidance.md +121 -0
- package/.agent/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
- package/.agent/skills/create-agent-skills/workflows/verify-skill.md +204 -0
- package/.agent/skills/data-integrity-guardian/SKILL.md +70 -0
- package/.agent/skills/data-migration-expert/SKILL.md +97 -0
- package/.agent/skills/deployment-verification-agent/SKILL.md +159 -0
- package/.agent/skills/design-implementation-reviewer/SKILL.md +85 -0
- package/.agent/skills/design-iterator/SKILL.md +197 -0
- package/.agent/skills/dhh-rails-reviewer/SKILL.md +45 -0
- package/.agent/skills/dhh-rails-style/SKILL.md +184 -0
- package/.agent/skills/dhh-rails-style/references/architecture.md +653 -0
- package/.agent/skills/dhh-rails-style/references/controllers.md +303 -0
- package/.agent/skills/dhh-rails-style/references/frontend.md +510 -0
- package/.agent/skills/dhh-rails-style/references/gems.md +266 -0
- package/.agent/skills/dhh-rails-style/references/models.md +359 -0
- package/.agent/skills/dhh-rails-style/references/testing.md +338 -0
- package/.agent/skills/dspy-ruby/SKILL.md +594 -0
- package/.agent/skills/dspy-ruby/assets/config-template.rb +359 -0
- package/.agent/skills/dspy-ruby/assets/module-template.rb +326 -0
- package/.agent/skills/dspy-ruby/assets/signature-template.rb +143 -0
- package/.agent/skills/dspy-ruby/references/core-concepts.md +265 -0
- package/.agent/skills/dspy-ruby/references/optimization.md +623 -0
- package/.agent/skills/dspy-ruby/references/providers.md +305 -0
- package/.agent/skills/every-style-editor/SKILL.md +134 -0
- package/.agent/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
- package/.agent/skills/figma-design-sync/SKILL.md +166 -0
- package/.agent/skills/file-todos/SKILL.md +251 -0
- package/.agent/skills/file-todos/assets/todo-template.md +155 -0
- package/.agent/skills/framework-docs-researcher/SKILL.md +83 -0
- package/.agent/skills/frontend-design/SKILL.md +42 -0
- package/.agent/skills/gemini-imagegen/SKILL.md +237 -0
- package/.agent/skills/gemini-imagegen/requirements.txt +2 -0
- package/.agent/skills/gemini-imagegen/scripts/compose_images.py +168 -0
- package/.agent/skills/gemini-imagegen/scripts/edit_image.py +157 -0
- package/.agent/skills/gemini-imagegen/scripts/gemini_images.py +265 -0
- package/.agent/skills/gemini-imagegen/scripts/generate_image.py +147 -0
- package/.agent/skills/gemini-imagegen/scripts/multi_turn_chat.py +215 -0
- package/.agent/skills/git-history-analyzer/SKILL.md +42 -0
- package/.agent/skills/git-worktree/SKILL.md +302 -0
- package/.agent/skills/git-worktree/scripts/worktree-manager.sh +345 -0
- package/.agent/skills/julik-frontend-races-reviewer/SKILL.md +222 -0
- package/.agent/skills/kieran-python-reviewer/SKILL.md +104 -0
- package/.agent/skills/kieran-rails-reviewer/SKILL.md +86 -0
- package/.agent/skills/kieran-typescript-reviewer/SKILL.md +95 -0
- package/.agent/skills/lint/SKILL.md +16 -0
- package/.agent/skills/pattern-recognition-specialist/SKILL.md +57 -0
- package/.agent/skills/performance-oracle/SKILL.md +110 -0
- package/.agent/skills/pr-comment-resolver/SKILL.md +69 -0
- package/.agent/skills/rclone/SKILL.md +150 -0
- package/.agent/skills/rclone/scripts/check_setup.sh +60 -0
- package/.agent/skills/repo-research-analyst/SKILL.md +113 -0
- package/.agent/skills/security-sentinel/SKILL.md +93 -0
- package/.agent/skills/skill-creator/SKILL.md +209 -0
- package/.agent/skills/skill-creator/scripts/init_skill.py +304 -0
- package/.agent/skills/skill-creator/scripts/package_skill.py +112 -0
- package/.agent/skills/skill-creator/scripts/quick_validate.py +72 -0
- package/.agent/skills/spec-flow-analyzer/SKILL.md +113 -0
- package/.agent/skills/test-agent/SKILL.md +4 -0
- package/.agent/workflows/agent-native-audit.md +277 -0
- package/.agent/workflows/ask-user-question.md +21 -0
- package/.agent/workflows/changelog.md +137 -0
- package/.agent/workflows/compound.md +202 -0
- package/.agent/workflows/create-agent-skill.md +8 -0
- package/.agent/workflows/deepen-plan-research.md +334 -0
- package/.agent/workflows/deepen-plan-synthesis.md +182 -0
- package/.agent/workflows/deepen-plan.md +79 -0
- package/.agent/workflows/feature-video.md +342 -0
- package/.agent/workflows/generate-command.md +162 -0
- package/.agent/workflows/heal-skill.md +142 -0
- package/.agent/workflows/lfg.md +20 -0
- package/.agent/workflows/plan-analysis.md +67 -0
- package/.agent/workflows/plan-next-steps.md +63 -0
- package/.agent/workflows/plan-review.md +33 -0
- package/.agent/workflows/plan-synthesis.md +106 -0
- package/.agent/workflows/plan.md +49 -0
- package/.agent/workflows/report-bug.md +150 -0
- package/.agent/workflows/reproduce-bug.md +99 -0
- package/.agent/workflows/resolve-parallel.md +34 -0
- package/.agent/workflows/resolve-pr-parallel.md +49 -0
- package/.agent/workflows/resolve-todo-parallel.md +35 -0
- package/.agent/workflows/review-analysis.md +145 -0
- package/.agent/workflows/review-synthesis.md +262 -0
- package/.agent/workflows/review.md +64 -0
- package/.agent/workflows/ship.md +90 -0
- package/.agent/workflows/test-command.md +3 -0
- package/.agent/workflows/triage.md +310 -0
- package/.agent/workflows/work.md +157 -0
- package/.agent/workflows/xcode-test.md +332 -0
- package/LICENSE +22 -0
- package/README.md +49 -0
- package/bin/ag-cortex.js +54 -0
- package/lib/core.js +165 -0
- package/package.json +31 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-browser
|
|
3
|
+
description: Run browser tests on pages affected by current PR or branch
|
|
4
|
+
argument-hint: "[PR number, branch name, or 'current' for current branch]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Browser Test Command
|
|
8
|
+
|
|
9
|
+
<command_purpose>Run end-to-end browser tests on pages affected by a PR or branch changes using agent-browser CLI.</command_purpose>
|
|
10
|
+
|
|
11
|
+
## CRITICAL: Use agent-browser CLI Only
|
|
12
|
+
|
|
13
|
+
**DO NOT use Chrome MCP tools (mcp__claude-in-chrome__*).**
|
|
14
|
+
|
|
15
|
+
This command uses the `agent-browser` CLI exclusively. The agent-browser CLI is a Bash-based tool from Vercel that runs headless Chromium. It is NOT the same as Chrome browser automation via MCP.
|
|
16
|
+
|
|
17
|
+
If you find yourself calling `mcp__claude-in-chrome__*` tools, STOP. Use `agent-browser` Bash commands instead.
|
|
18
|
+
|
|
19
|
+
## Introduction
|
|
20
|
+
|
|
21
|
+
<role>QA Engineer specializing in browser-based end-to-end testing</role>
|
|
22
|
+
|
|
23
|
+
This command tests affected pages in a real browser, catching issues that unit tests miss:
|
|
24
|
+
- JavaScript integration bugs
|
|
25
|
+
- CSS/layout regressions
|
|
26
|
+
- User workflow breakages
|
|
27
|
+
- Console errors
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
<requirements>
|
|
32
|
+
- Local development server running (e.g., `bin/dev`, `rails server`, `npm run dev`)
|
|
33
|
+
- agent-browser CLI installed (see Setup below)
|
|
34
|
+
- Git repository with changes to test
|
|
35
|
+
</requirements>
|
|
36
|
+
|
|
37
|
+
## Setup
|
|
38
|
+
|
|
39
|
+
**Check installation:**
|
|
40
|
+
```bash
|
|
41
|
+
command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Install if needed:**
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g agent-browser
|
|
47
|
+
agent-browser install # Downloads Chromium (~160MB)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
See the `agent-browser` skill for detailed usage.
|
|
51
|
+
|
|
52
|
+
## Main Tasks
|
|
53
|
+
|
|
54
|
+
### 0. Verify agent-browser Installation
|
|
55
|
+
|
|
56
|
+
Before starting ANY browser testing, verify agent-browser is installed:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
command -v agent-browser >/dev/null 2>&1 && echo "Ready" || (echo "Installing..." && npm install -g agent-browser && agent-browser install)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If installation fails, inform the user and stop.
|
|
63
|
+
|
|
64
|
+
### 1. Ask Browser Mode
|
|
65
|
+
|
|
66
|
+
<ask_browser_mode>
|
|
67
|
+
|
|
68
|
+
Before starting tests, ask user if they want to watch the browser:
|
|
69
|
+
|
|
70
|
+
Use AskUserQuestion with:
|
|
71
|
+
- Question: "Do you want to watch the browser tests run?"
|
|
72
|
+
- Options:
|
|
73
|
+
1. **Headed (watch)** - Opens visible browser window so you can see tests run
|
|
74
|
+
2. **Headless (faster)** - Runs in background, faster but invisible
|
|
75
|
+
|
|
76
|
+
Store the choice and use `--headed` flag when user selects "Headed".
|
|
77
|
+
|
|
78
|
+
</ask_browser_mode>
|
|
79
|
+
|
|
80
|
+
### 2. Determine Test Scope
|
|
81
|
+
|
|
82
|
+
<test_target> $ARGUMENTS </test_target>
|
|
83
|
+
|
|
84
|
+
<determine_scope>
|
|
85
|
+
|
|
86
|
+
**If PR number provided:**
|
|
87
|
+
```bash
|
|
88
|
+
gh pr view [number] --json files -q '.files[].path'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**If 'current' or empty:**
|
|
92
|
+
```bash
|
|
93
|
+
git diff --name-only main...HEAD
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**If branch name provided:**
|
|
97
|
+
```bash
|
|
98
|
+
git diff --name-only main...[branch]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
</determine_scope>
|
|
102
|
+
|
|
103
|
+
### 3. Map Files to Routes
|
|
104
|
+
|
|
105
|
+
<file_to_route_mapping>
|
|
106
|
+
|
|
107
|
+
Map changed files to testable routes:
|
|
108
|
+
|
|
109
|
+
| File Pattern | Route(s) |
|
|
110
|
+
|-------------|----------|
|
|
111
|
+
| `app/views/users/*` | `/users`, `/users/:id`, `/users/new` |
|
|
112
|
+
| `app/controllers/settings_controller.rb` | `/settings` |
|
|
113
|
+
| `app/javascript/controllers/*_controller.js` | Pages using that Stimulus controller |
|
|
114
|
+
| `app/components/*_component.rb` | Pages rendering that component |
|
|
115
|
+
| `app/views/layouts/*` | All pages (test homepage at minimum) |
|
|
116
|
+
| `app/assets/stylesheets/*` | Visual regression on key pages |
|
|
117
|
+
| `app/helpers/*_helper.rb` | Pages using that helper |
|
|
118
|
+
| `src/app/*` (Next.js) | Corresponding routes |
|
|
119
|
+
| `src/components/*` | Pages using those components |
|
|
120
|
+
|
|
121
|
+
Build a list of URLs to test based on the mapping.
|
|
122
|
+
|
|
123
|
+
</file_to_route_mapping>
|
|
124
|
+
|
|
125
|
+
### 4. Verify Server is Running
|
|
126
|
+
|
|
127
|
+
<check_server>
|
|
128
|
+
|
|
129
|
+
Before testing, verify the local server is accessible:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
agent-browser open http://localhost:3000
|
|
133
|
+
agent-browser snapshot -i
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If server is not running, inform user:
|
|
137
|
+
```markdown
|
|
138
|
+
**Server not running**
|
|
139
|
+
|
|
140
|
+
Please start your development server:
|
|
141
|
+
- Rails: `bin/dev` or `rails server`
|
|
142
|
+
- Node/Next.js: `npm run dev`
|
|
143
|
+
|
|
144
|
+
Then run `/test-browser` again.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
</check_server>
|
|
148
|
+
|
|
149
|
+
### 5. Test Each Affected Page
|
|
150
|
+
|
|
151
|
+
<test_pages>
|
|
152
|
+
|
|
153
|
+
For each affected route, use agent-browser CLI commands (NOT Chrome MCP):
|
|
154
|
+
|
|
155
|
+
**Step 1: Navigate and capture snapshot**
|
|
156
|
+
```bash
|
|
157
|
+
agent-browser open "http://localhost:3000/[route]"
|
|
158
|
+
agent-browser snapshot -i
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Step 2: For headed mode (visual debugging)**
|
|
162
|
+
```bash
|
|
163
|
+
agent-browser --headed open "http://localhost:3000/[route]"
|
|
164
|
+
agent-browser --headed snapshot -i
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Step 3: Verify key elements**
|
|
168
|
+
- Use `agent-browser snapshot -i` to get interactive elements with refs
|
|
169
|
+
- Page title/heading present
|
|
170
|
+
- Primary content rendered
|
|
171
|
+
- No error messages visible
|
|
172
|
+
- Forms have expected fields
|
|
173
|
+
|
|
174
|
+
**Step 4: Test critical interactions**
|
|
175
|
+
```bash
|
|
176
|
+
agent-browser click @e1 # Use ref from snapshot
|
|
177
|
+
agent-browser snapshot -i
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Step 5: Take screenshots**
|
|
181
|
+
```bash
|
|
182
|
+
agent-browser screenshot page-name.png
|
|
183
|
+
agent-browser screenshot --full page-name-full.png # Full page
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
</test_pages>
|
|
187
|
+
|
|
188
|
+
### 6. Human Verification (When Required)
|
|
189
|
+
|
|
190
|
+
<human_verification>
|
|
191
|
+
|
|
192
|
+
Pause for human input when testing touches:
|
|
193
|
+
|
|
194
|
+
| Flow Type | What to Ask |
|
|
195
|
+
|-----------|-------------|
|
|
196
|
+
| OAuth | "Please sign in with [provider] and confirm it works" |
|
|
197
|
+
| Email | "Check your inbox for the test email and confirm receipt" |
|
|
198
|
+
| Payments | "Complete a test purchase in sandbox mode" |
|
|
199
|
+
| SMS | "Verify you received the SMS code" |
|
|
200
|
+
| External APIs | "Confirm the [service] integration is working" |
|
|
201
|
+
|
|
202
|
+
Use AskUserQuestion:
|
|
203
|
+
```markdown
|
|
204
|
+
**Human Verification Needed**
|
|
205
|
+
|
|
206
|
+
This test touches the [flow type]. Please:
|
|
207
|
+
1. [Action to take]
|
|
208
|
+
2. [What to verify]
|
|
209
|
+
|
|
210
|
+
Did it work correctly?
|
|
211
|
+
1. Yes - continue testing
|
|
212
|
+
2. No - describe the issue
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
</human_verification>
|
|
216
|
+
|
|
217
|
+
### 7. Handle Failures
|
|
218
|
+
|
|
219
|
+
<failure_handling>
|
|
220
|
+
|
|
221
|
+
When a test fails:
|
|
222
|
+
|
|
223
|
+
1. **Document the failure:**
|
|
224
|
+
- Screenshot the error state: `agent-browser screenshot error.png`
|
|
225
|
+
- Note the exact reproduction steps
|
|
226
|
+
|
|
227
|
+
2. **Ask user how to proceed:**
|
|
228
|
+
```markdown
|
|
229
|
+
**Test Failed: [route]**
|
|
230
|
+
|
|
231
|
+
Issue: [description]
|
|
232
|
+
Console errors: [if any]
|
|
233
|
+
|
|
234
|
+
How to proceed?
|
|
235
|
+
1. Fix now - I'll help debug and fix
|
|
236
|
+
2. Create todo - Add to todos/ for later
|
|
237
|
+
3. Skip - Continue testing other pages
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
3. **If "Fix now":**
|
|
241
|
+
- Investigate the issue
|
|
242
|
+
- Propose a fix
|
|
243
|
+
- Apply fix
|
|
244
|
+
- Re-run the failing test
|
|
245
|
+
|
|
246
|
+
4. **If "Create todo":**
|
|
247
|
+
- Create `{id}-pending-p1-browser-test-{description}.md`
|
|
248
|
+
- Continue testing
|
|
249
|
+
|
|
250
|
+
5. **If "Skip":**
|
|
251
|
+
- Log as skipped
|
|
252
|
+
- Continue testing
|
|
253
|
+
|
|
254
|
+
</failure_handling>
|
|
255
|
+
|
|
256
|
+
### 8. Test Summary
|
|
257
|
+
|
|
258
|
+
<test_summary>
|
|
259
|
+
|
|
260
|
+
After all tests complete, present summary:
|
|
261
|
+
|
|
262
|
+
```markdown
|
|
263
|
+
## Browser Test Results
|
|
264
|
+
|
|
265
|
+
**Test Scope:** PR #[number] / [branch name]
|
|
266
|
+
**Server:** http://localhost:3000
|
|
267
|
+
|
|
268
|
+
### Pages Tested: [count]
|
|
269
|
+
|
|
270
|
+
| Route | Status | Notes |
|
|
271
|
+
|-------|--------|-------|
|
|
272
|
+
| `/users` | Pass | |
|
|
273
|
+
| `/settings` | Pass | |
|
|
274
|
+
| `/dashboard` | Fail | Console error: [msg] |
|
|
275
|
+
| `/checkout` | Skip | Requires payment credentials |
|
|
276
|
+
|
|
277
|
+
### Console Errors: [count]
|
|
278
|
+
- [List any errors found]
|
|
279
|
+
|
|
280
|
+
### Human Verifications: [count]
|
|
281
|
+
- OAuth flow: Confirmed
|
|
282
|
+
- Email delivery: Confirmed
|
|
283
|
+
|
|
284
|
+
### Failures: [count]
|
|
285
|
+
- `/dashboard` - [issue description]
|
|
286
|
+
|
|
287
|
+
### Created Todos: [count]
|
|
288
|
+
- `005-pending-p1-browser-test-dashboard-error.md`
|
|
289
|
+
|
|
290
|
+
### Result: [PASS / FAIL / PARTIAL]
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
</test_summary>
|
|
294
|
+
|
|
295
|
+
## Quick Usage Examples
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# Test current branch changes
|
|
299
|
+
/test-browser
|
|
300
|
+
|
|
301
|
+
# Test specific PR
|
|
302
|
+
/test-browser 847
|
|
303
|
+
|
|
304
|
+
# Test specific branch
|
|
305
|
+
/test-browser feature/new-dashboard
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## agent-browser CLI Reference
|
|
309
|
+
|
|
310
|
+
**ALWAYS use these Bash commands. NEVER use mcp__claude-in-chrome__* tools.**
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# Navigation
|
|
314
|
+
agent-browser open <url> # Navigate to URL
|
|
315
|
+
agent-browser back # Go back
|
|
316
|
+
agent-browser close # Close browser
|
|
317
|
+
|
|
318
|
+
# Snapshots (get element refs)
|
|
319
|
+
agent-browser snapshot -i # Interactive elements with refs (@e1, @e2, etc.)
|
|
320
|
+
agent-browser snapshot -i --json # JSON output
|
|
321
|
+
|
|
322
|
+
# Interactions (use refs from snapshot)
|
|
323
|
+
agent-browser click @e1 # Click element
|
|
324
|
+
agent-browser fill @e1 "text" # Fill input
|
|
325
|
+
agent-browser type @e1 "text" # Type without clearing
|
|
326
|
+
agent-browser press Enter # Press key
|
|
327
|
+
|
|
328
|
+
# Screenshots
|
|
329
|
+
agent-browser screenshot out.png # Viewport screenshot
|
|
330
|
+
agent-browser screenshot --full out.png # Full page screenshot
|
|
331
|
+
|
|
332
|
+
# Headed mode (visible browser)
|
|
333
|
+
agent-browser --headed open <url> # Open with visible browser
|
|
334
|
+
agent-browser --headed click @e1 # Click in visible browser
|
|
335
|
+
|
|
336
|
+
# Wait
|
|
337
|
+
agent-browser wait @e1 # Wait for element
|
|
338
|
+
agent-browser wait 2000 # Wait milliseconds
|
|
339
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Antigravity Codex
|
|
2
|
+
|
|
3
|
+
This is the central "brain" for Antigravity-powered agents. It defines the core primitives—Skills, Workflows, and Rules—and how they should be used to maintain a high standard of engineering.
|
|
4
|
+
|
|
5
|
+
## Core Primitives
|
|
6
|
+
|
|
7
|
+
| Primitive | Definition | Activation | Analogy | Directory |
|
|
8
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
9
|
+
| **Skills** | Capabilities the agent "knows" how to do. Discovered automatically. | **Auto-detected** (Pull) | **Toolbelt** | `.agent/skills/` |
|
|
10
|
+
| **Workflows** | Standard Operating Procedures (SOPs) for linear processes. | **User-Invoked** (Push) | **Runbook** | `.agent/workflows/` |
|
|
11
|
+
| **Rules** | Constraints, persona definitions, and "constitution" files. | **Context** (Always On) | **Identity** | `.agent/rules/` |
|
|
12
|
+
|
|
13
|
+
## Repository Structure
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
antigravity-cortex/
|
|
17
|
+
├── .agent/
|
|
18
|
+
│ ├── rules/ # Context & Identity (e.g., specific engineering personas)
|
|
19
|
+
│ ├── skills/ # Capabilities (formerly plugins)
|
|
20
|
+
│ ├── workflows/ # Step-by-step procedures (formerly plans/workflows)
|
|
21
|
+
│ └── templates/ # Templates for plans and documents
|
|
22
|
+
└── README.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Philosophy: Compounding Engineering
|
|
26
|
+
|
|
27
|
+
**Each unit of engineering work should make subsequent units of work easier—not harder.**
|
|
28
|
+
|
|
29
|
+
1. **Plan** → Stop and architect before coding.
|
|
30
|
+
2. **Work** → Execute the code using your Skills.
|
|
31
|
+
3. **Review** → Verify against Rules and standards.
|
|
32
|
+
4. **Compound** → Save lessons learned into Rules or Skills so mistakes aren't repeated.
|
|
33
|
+
|
|
34
|
+
## Maintenance
|
|
35
|
+
|
|
36
|
+
### Updating Skills
|
|
37
|
+
Skills are folders in `.agent/skills/` containing a `SKILL.md`. When adding a new capability (e.g., a new language or framework tool), add it here.
|
|
38
|
+
|
|
39
|
+
### Updating Workflows
|
|
40
|
+
Workflows are `.md` files in `.agent/workflows/`. These are for processes you explicitly trigger (e.g., `prepare-pr`, `deploy`).
|
|
41
|
+
|
|
42
|
+
### Updating Rules
|
|
43
|
+
Rules are loaded into context. Use these for broad directives (e.g., "Always use TypeScript", "Act as a Principal Engineer").
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
*Generated for Antigravity Cortex*
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Cortex Lab Project Rules
|
|
2
|
+
|
|
3
|
+
This file documents the project's rules, conventions, and workflows. It was migrated from `CLAUDE.md`.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- **`/release-docs`**: Run the release-docs command to update all documentation pages.
|
|
8
|
+
- **`/review`**: Run the review command to perform exhaustive code reviews.
|
|
9
|
+
- **`/test-browser`**: Run browser tests using Playwright.
|
|
10
|
+
- **`/xcode-test`**: Run iOS tests using Xcode simulator.
|
|
11
|
+
|
|
12
|
+
## Project Structure
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
cortex/
|
|
16
|
+
├── .agent/
|
|
17
|
+
│ ├── rules/ # Project rules and conventions
|
|
18
|
+
│ ├── skills/ # Specialized agent skills
|
|
19
|
+
│ └── workflows/ # Automated workflows
|
|
20
|
+
├── docs/ # Documentation site (HTML/CSS)
|
|
21
|
+
├── plugins/ # Plugin source code
|
|
22
|
+
└── ...
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
The documentation site is at `/docs` in the repository root.
|
|
28
|
+
|
|
29
|
+
### Keeping Docs Up-to-Date
|
|
30
|
+
|
|
31
|
+
After ANY change to agents, commands, skills, or MCP servers, update documentation.
|
|
32
|
+
|
|
33
|
+
## Commit Conventions
|
|
34
|
+
|
|
35
|
+
Follow these patterns for commit messages:
|
|
36
|
+
|
|
37
|
+
- `Add [agent/command name]` - Adding new functionality
|
|
38
|
+
- `Remove [agent/command name]` - Removing functionality
|
|
39
|
+
- `Update [file] to [what changed]` - Updating existing files
|
|
40
|
+
- `Fix [issue]` - Bug fixes
|
|
41
|
+
- `Simplify [component] to [improvement]` - Refactoring
|
|
42
|
+
|
|
43
|
+
## Key Learnings
|
|
44
|
+
|
|
45
|
+
### 2024-11-22: Added gemini-imagegen skill and fixed component counts
|
|
46
|
+
Always count actual files before updating descriptions.
|
|
47
|
+
|
|
48
|
+
### 2024-10-09: Simplified marketplace.json to match official spec
|
|
49
|
+
Stick to the official spec. Custom fields may confuse users.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-browser
|
|
3
|
+
description: Browser automation using Vercel's agent-browser CLI. Use when you need to interact with web pages, fill forms, take screenshots, or scrape data. Alternative to Playwright MCP - uses Bash commands with ref-based element selection. Triggers on "browse website", "fill form", "click button", "take screenshot", "scrape page", "web automation".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# agent-browser: CLI Browser Automation
|
|
7
|
+
|
|
8
|
+
Vercel's headless browser automation CLI designed for AI agents. Uses ref-based selection (@e1, @e2) from accessibility snapshots.
|
|
9
|
+
|
|
10
|
+
## Setup Check
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Check installation
|
|
14
|
+
command -v agent-browser >/dev/null 2>&1 && echo "Installed" || echo "NOT INSTALLED - run: npm install -g agent-browser && agent-browser install"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Install if needed
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g agent-browser
|
|
21
|
+
agent-browser install # Downloads Chromium
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Core Workflow
|
|
25
|
+
|
|
26
|
+
**The snapshot + ref pattern is optimal for LLMs:**
|
|
27
|
+
|
|
28
|
+
1. **Navigate** to URL
|
|
29
|
+
2. **Snapshot** to get interactive elements with refs
|
|
30
|
+
3. **Interact** using refs (@e1, @e2, etc.)
|
|
31
|
+
4. **Re-snapshot** after navigation or DOM changes
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Step 1: Open URL
|
|
35
|
+
agent-browser open https://example.com
|
|
36
|
+
|
|
37
|
+
# Step 2: Get interactive elements with refs
|
|
38
|
+
agent-browser snapshot -i --json
|
|
39
|
+
|
|
40
|
+
# Step 3: Interact using refs
|
|
41
|
+
agent-browser click @e1
|
|
42
|
+
agent-browser fill @e2 "search query"
|
|
43
|
+
|
|
44
|
+
# Step 4: Re-snapshot after changes
|
|
45
|
+
agent-browser snapshot -i
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Key Commands
|
|
49
|
+
|
|
50
|
+
### Navigation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
agent-browser open <url> # Navigate to URL
|
|
54
|
+
agent-browser back # Go back
|
|
55
|
+
agent-browser forward # Go forward
|
|
56
|
+
agent-browser reload # Reload page
|
|
57
|
+
agent-browser close # Close browser
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Snapshots (Essential for AI)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
agent-browser snapshot # Full accessibility tree
|
|
64
|
+
agent-browser snapshot -i # Interactive elements only (recommended)
|
|
65
|
+
agent-browser snapshot -i --json # JSON output for parsing
|
|
66
|
+
agent-browser snapshot -c # Compact (remove empty elements)
|
|
67
|
+
agent-browser snapshot -d 3 # Limit depth
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Interactions
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
agent-browser click @e1 # Click element
|
|
74
|
+
agent-browser dblclick @e1 # Double-click
|
|
75
|
+
agent-browser fill @e1 "text" # Clear and fill input
|
|
76
|
+
agent-browser type @e1 "text" # Type without clearing
|
|
77
|
+
agent-browser press Enter # Press key
|
|
78
|
+
agent-browser hover @e1 # Hover element
|
|
79
|
+
agent-browser check @e1 # Check checkbox
|
|
80
|
+
agent-browser uncheck @e1 # Uncheck checkbox
|
|
81
|
+
agent-browser select @e1 "option" # Select dropdown option
|
|
82
|
+
agent-browser scroll down 500 # Scroll (up/down/left/right)
|
|
83
|
+
agent-browser scrollintoview @e1 # Scroll element into view
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Get Information
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
agent-browser get text @e1 # Get element text
|
|
90
|
+
agent-browser get html @e1 # Get element HTML
|
|
91
|
+
agent-browser get value @e1 # Get input value
|
|
92
|
+
agent-browser get attr href @e1 # Get attribute
|
|
93
|
+
agent-browser get title # Get page title
|
|
94
|
+
agent-browser get url # Get current URL
|
|
95
|
+
agent-browser get count "button" # Count matching elements
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Screenshots & PDFs
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
agent-browser screenshot # Viewport screenshot
|
|
102
|
+
agent-browser screenshot --full # Full page
|
|
103
|
+
agent-browser screenshot output.png # Save to file
|
|
104
|
+
agent-browser screenshot --full output.png # Full page to file
|
|
105
|
+
agent-browser pdf output.pdf # Save as PDF
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Wait
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
agent-browser wait @e1 # Wait for element
|
|
112
|
+
agent-browser wait 2000 # Wait milliseconds
|
|
113
|
+
agent-browser wait "text" # Wait for text to appear
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Semantic Locators (Alternative to Refs)
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
agent-browser find role button click --name "Submit"
|
|
120
|
+
agent-browser find text "Sign up" click
|
|
121
|
+
agent-browser find label "Email" fill "user@example.com"
|
|
122
|
+
agent-browser find placeholder "Search..." fill "query"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Sessions (Parallel Browsers)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Run multiple independent browser sessions
|
|
129
|
+
agent-browser --session browser1 open https://site1.com
|
|
130
|
+
agent-browser --session browser2 open https://site2.com
|
|
131
|
+
|
|
132
|
+
# List active sessions
|
|
133
|
+
agent-browser session list
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Examples
|
|
137
|
+
|
|
138
|
+
### Login Flow
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
agent-browser open https://app.example.com/login
|
|
142
|
+
agent-browser snapshot -i
|
|
143
|
+
# Output shows: textbox "Email" [ref=e1], textbox "Password" [ref=e2], button "Sign in" [ref=e3]
|
|
144
|
+
agent-browser fill @e1 "user@example.com"
|
|
145
|
+
agent-browser fill @e2 "password123"
|
|
146
|
+
agent-browser click @e3
|
|
147
|
+
agent-browser wait 2000
|
|
148
|
+
agent-browser snapshot -i # Verify logged in
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Search and Extract
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
agent-browser open https://news.ycombinator.com
|
|
155
|
+
agent-browser snapshot -i --json
|
|
156
|
+
# Parse JSON to find story links
|
|
157
|
+
agent-browser get text @e12 # Get headline text
|
|
158
|
+
agent-browser click @e12 # Click to open story
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Form Filling
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
agent-browser open https://forms.example.com
|
|
165
|
+
agent-browser snapshot -i
|
|
166
|
+
agent-browser fill @e1 "John Doe"
|
|
167
|
+
agent-browser fill @e2 "john@example.com"
|
|
168
|
+
agent-browser select @e3 "United States"
|
|
169
|
+
agent-browser check @e4 # Agree to terms
|
|
170
|
+
agent-browser click @e5 # Submit button
|
|
171
|
+
agent-browser screenshot confirmation.png
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Debug Mode
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Run with visible browser window
|
|
178
|
+
agent-browser --headed open https://example.com
|
|
179
|
+
agent-browser --headed snapshot -i
|
|
180
|
+
agent-browser --headed click @e1
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## JSON Output
|
|
184
|
+
|
|
185
|
+
Add `--json` for structured output:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
agent-browser snapshot -i --json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"success": true,
|
|
195
|
+
"data": {
|
|
196
|
+
"refs": {
|
|
197
|
+
"e1": {"name": "Submit", "role": "button"},
|
|
198
|
+
"e2": {"name": "Email", "role": "textbox"}
|
|
199
|
+
},
|
|
200
|
+
"snapshot": "- button \"Submit\" [ref=e1]\n- textbox \"Email\" [ref=e2]"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## vs Playwright MCP
|
|
206
|
+
|
|
207
|
+
| Feature | agent-browser (CLI) | Playwright MCP |
|
|
208
|
+
|---------|---------------------|----------------|
|
|
209
|
+
| Interface | Bash commands | MCP tools |
|
|
210
|
+
| Selection | Refs (@e1) | Refs (e1) |
|
|
211
|
+
| Output | Text/JSON | Tool responses |
|
|
212
|
+
| Parallel | Sessions | Tabs |
|
|
213
|
+
| Best for | Quick automation | Tool integration |
|
|
214
|
+
|
|
215
|
+
Use agent-browser when:
|
|
216
|
+
- You prefer Bash-based workflows
|
|
217
|
+
- You want simpler CLI commands
|
|
218
|
+
- You need quick one-off automation
|
|
219
|
+
|
|
220
|
+
Use Playwright MCP when:
|
|
221
|
+
- You need deep MCP tool integration
|
|
222
|
+
- You want tool-based responses
|
|
223
|
+
- You're building complex automation
|